package cn.classTest.mall.domain;

import com.alibaba.fastjson.JSON;
import lombok.Data;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Component
@Data
public class Mall {
    private Long id;
    private String name;
    private String sn;
    private Boolean status = false;
    private List<Shop> shops;
    private Long mallGoodsNum;

    private String json;

    public String getJson() {
        Map<String, Object> map = new HashMap<>();
        map.put("id",id);
        map.put("name",name);
        map.put("sn",sn);
        map.put("status",status);
        map.put("shops",shops);
        map.put("mallGoodsNum",mallGoodsNum);
        return JSON.toJSONString(map);
    }
}
